#include "allocation.h"
#include <string.h>
#include <stdlib.h>

char *htx_alloc_buf_status_code ()
{
	char *buf = htx_malloc_and_set (ALLOCATED_BUF_STATUS_CODE_SIZE, 0);
	return buf;
}

void *htx_malloc_and_set (uint64_t size, uint8_t byte)
{
	void *data = malloc (size);
	memset (data, byte, size);
	return data;
}

void *htx_alloc_http_config ()
{
	struct htx_http_config *cfg = malloc (sizeof (struct htx_http_config));
	memset (cfg, 0, sizeof (struct htx_http_config));

	return cfg;
}
